package view
{
	import com.bit101.components.ImageEmbedButton;
	
	import flash.display.Bitmap;
	import flash.display.Shape;
	import flash.display.Sprite;
	import flash.events.MouseEvent;
	import flash.text.TextField;
	
	public class UploadAlert extends Sprite
	{
		[Embed(source="assets/btns/uploadAlert.png")]
		private var bgCls:Class;
		
		private var mainTxt:TextField;
		private var bgSp:Shape;
		private var processSp:Shape;
		public function UploadAlert()
		{
			init();
		}
		private function init():void{
			var bgbitmap:Bitmap = new bgCls();
			this.addChild(bgbitmap);
			
			mainTxt = new TextField;
			mainTxt.width = 280;
			mainTxt.height = 70;
			mainTxt.wordWrap = true;
			mainTxt.multiline = true;
			mainTxt.x = 10;
			mainTxt.y = 130;
			this.addChild(mainTxt);
			
			bgSp = new Shape;//240,20 30,100
			bgSp.graphics.beginFill(0x999999);
			bgSp.graphics.drawRoundRect(30,100,240,20,20,20);
			bgSp.graphics.endFill();
			this.addChild(bgSp);
			
			processSp = new Shape;
			this.addChild(processSp);
		}
		
		public function setInfo(str:String):void{
			mainTxt.htmlText = "<p align='center'><font face='微软雅黑' color='#656565' size='17'><b>"+ str +"</b></font></p>"
		}
		
		public function setProgress(value:Number):void{
			processSp.graphics.clear();
			processSp.graphics.beginFill(0x666666);
			processSp.graphics.drawRoundRect(30,100,240*value,20,20,20);
			processSp.graphics.endFill();
		}
		
		
	}
}